import random
p = 3



pstr=str(p)
c = ''
cint = ''
def getGuess():
    while True:
        print('מה התשובה')
        c = input()
            
           
            
        while c not in '123456789101112131415161718192021222324252627282930לא31323334353637383940414243444546474849505152535455565758596061626364656667686970':     
            if c not in '123456789101112131415161718192021222324252627282930לא31323334353637383940414243444546474849505152535455565758596061626364656667686970':
                print('בבקשה תקישי מיספר עד 30')
                c = input()

                
        if c != 'לא' and c in '123456789101112131415161718192021222324252627282930לא31323334353637383940414243444546474849505152535455565758596061626364656667686970':
            cint = int(c)
            return cint

        else:
            return c

while cint != 'לא':

    while p > 0 and cint != 'ל' or cint != 'לא' and p <= 10:

        if p >= 20:
            break
            

        a = random.randint(1, 10)
        b = random.randint(1, 10)
        astr = str(a)
        bstr = str(b)
        print(astr + '+' + bstr +'=?')

        cint = getGuess()

        if cint == 'לא':
            break
            
        
        

        if cint == a + b:
            print('נכון')
            p = p + 2
            pstr=str(p)

        if cint != a + b:
            print('לא נכון')
            p = p - 2
            pstr=str(p)
            
        print('יש לך '+pstr+' נקודות')

        
        

    while p > 0 and cint != 'לא' and p > 10 and p < 20:

        if p >= 30:
            break

        a = random.randint(1, 10) + 3
        b = random.randint(1, 10) + 5
        astr = str(a)
        bstr = str(b)
        print(astr + '+' + bstr +'=?')

        cint = getGuess()

        if cint == 'לא':
            break
            
        

        if cint == a + b:
            print('נכון')
            p = p + 2
            

        if cint != a + b:
            print('לא נכון')
            p = p - 2
            
        pstr=str(p)
        print('יש לך '+pstr+' נקודות')
        
    while p > 0 and cint != 'לא' and p > 20 and p < 30:

        if p >= 30:
            print('-ילה בוא נעבור ל')
            break

        a = random.randint(1, 10) + 3
        b = random.randint(1, 10) + 5
        astr = str(a)
        bstr = str(b)

        if a > b:
            print(astr + '-' + bstr +'=?')

        if a < b:
            print(bstr + '-' + astr +'=?')

        cint = getGuess()

        if cint == 'לא':
            break
            
        

        if a > b and cint == a - b:
            p = p + 2
            print('נכון')

        if a > b and cint != a - b:
            p = p - 2
            print('לא נכון')

        if a < b and cint == b - a:
            p = p + 2
            print('נכון')

        if a < b and cint != b - a:
            p = p - 2
            print('לא נכון')

        pstr=str(p)
        print('יש לך '+pstr+' נקודות')

    while p > 30:

        if p > 40:
            break
        

        a = random.randint(-12, 19) + 7
        b = random.randint(1, 25) + 10
        astr = str(a)
        bstr = str(b)

        if a > b:
            print(astr + '-' + bstr +'=?')

        if a < b:
            print(bstr + '-' + astr +'=?')


        cint = getGuess()

        if cint == 'לא':
            break
            

        if a > b and cint == a - b:
            p = p + 2
            print('נכון')

        if a > b and cint != a - b:
            p = p - 2
            print('לא נכון')

        if a < b and cint == b - a:
            p = p + 2
            print('נכון')

        if a < b and cint != b - a:
            p = p - 2
            print('לא נכון')

        pstr=str(p)
        print('יש לך '+pstr+' נקודות')

        
    while p > 40:

        if p >= 50:
            print('+סימתה את השלב עכשיו ל')
            break

        a = random.randint(-12, 19) + 15
        b = random.randint(1, 25) + 18
        astr = str(a)
        bstr = str(b)

        if a > b:
            print(astr + '-' + bstr +'=?')

        if a < b:
            print(bstr + '-' + astr +'=?')

        cint = getGuess()

        if cint == 'לא':
            break
            

        if a > b and cint == a - b:
            p = p + 2
            print('נכון')

        if a > b and cint != a - b:
            p = p - 2
            print('לא נכון')

        if a < b and cint == b - a:
            p = p + 2
            print('נכון')

        if a < b and cint != b - a:
            p = p - 2
            print('לא נכון')

        pstr=str(p)
        print('יש לך '+pstr+' נקודות')




    while p > 0 and cint != 'ל' and cint != 'לא' and p <= 50:
  

        if p >= 60:
            print('+סימתה את השלב עכשיו ל')
            break


            

        a = random.randint(0, 3)
        b = random.randint(0, 3)
        astr = str(a)
        bstr = str(b)
        print(astr + '*' + bstr +'=?')

        cint = getGuess()

        if cint == 'לא':
            break
            
        
        

        if cint == a * b:
            print('נכון')
            p = p + 2
            pstr=str(p)

        if cint != a * b:
            print('לא נכון')
            p = p - 2
            pstr=str(p)
            
        print('יש לך '+pstr+' נקודות')

    while p > 0 and cint != 'ל' and cint != 'לא' and p <= 60:


        if p >= 70:
            print('+סימתה את השלב עכשיו ל')
            break

        if cint == 'לא':
            break
            

        a = random.randint(0, 4)
        b = random.randint(0, 4)
        astr = str(a)
        bstr = str(b)
        print(astr + '*' + bstr +'=?')

        cint = getGuess()

        if cint == 'לא':
            break
            
        
        

        if cint == a * b:
            print('נכון')
            p = p + 2
            pstr=str(p)

        if cint != a * b:
            print('לא נכון')
            p = p - 2
            pstr=str(p)
            
        print('יש לך '+pstr+' נקודות')

        
 
